<?php
$this->breadcrumbs=array(
	Yii::t('labs', 'Labs')=>array('index'),
	$model->project->pro_title=>array('sview','id'=>$model->project->pro_id),
	'更新解决方案'

);

$this->menu=array(
	array('label'=>'List Project', 'url'=>array('index')),
	array('label'=>'Create Project', 'url'=>array('create')),
	array('label'=>'View Project', 'url'=>array('view')),
	array('label'=>'Manage Project', 'url'=>array('admin')),
);


//定义URL地址
$createUrl = $this->createUrl('/labs/usolution',array('id'=>$_GET['id']));
?>
<script type="text/javascript">
<!--
$(function(){
	
	$("#parallaxButton").click(function(){


		if(editor_a.hasContents()){
			
			var data = {
				'Solution[sol_pid]':<?php echo $model->project->pro_id; ?>,
				'Solution[sol_content]':editor_a.getContent(),
				'rn':Math.random()
			};

			$.post('<?php echo $createUrl;?>', data, function(msg){

				msg = msg.split('_#_');

				if(msg[0] == 'success'){
				    $.msgbox({
					    height:100,
					    width:300,
					    content:{type:'confirm', content: '现在添加新的项目解决方案吗？<br /><a href="' + msg[1] +'">添加解决方案</a>'},
					    animation:4,
					    onClose:function(v){
					        if(v){	                   
					        	location.href = '<?php echo $this->createUrl('solution',array('id'=>$_GET['id']));?>';
					      
					        }else{
								location.href = msg[1];<?php //echo $this->createUrl('list');?>
					        }
					        
					    }
					}); 
				}
				
				console.log(msg);
			});			
			
		}else{
		    $.msgbox({
			    height:100,
			    width:300,
			    content:{type:'alert', content: '课题解决方案内容简介不能为空！'},
			    animation:4

			}); 
		}
	});
	
});
//-->
</script>
<div class="articlePanel panelsContainer">
	<?php $this->widget('application.components.link.LabsPrevNextWidget',array(
		'id'=>$_GET['id']
	))?>
	<hr />
	<div id="articlePage">
		<div id="articleContent">	
			<div class="note">
				课题描述：<p><?php echo Project::model()->getBrifeDescript($model->project, 500) ;?></p>
				<hr class="space" />
				<?php echo Yii::t('common','<span>Post By {user} On {time} Hits {hits}　{link}</span>',array(
					'{user}'=> $model->project->user->user_name,
					'{time}' => UtilTools::timeop($model->project->pro_created),
					'{hits}' => $model->project->pro_hits,
					'{link}' => UtilAuth::getAuthLinks('编辑', array('update','id'=>$model->project->pro_id))
				));?>				
			</div>
			<?php echo $this->renderPartial('_sform', array('model'=>$model)); ?>
		</div>
	</div>
</div>